﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using Resources;

namespace TorchlightModOverseer.Controls
{
	public class TorchlightButton : Button
	{
		public TorchlightButton()
		{
			Size = new Size(220, 40);
			MinimumSize = Size;
			MaximumSize = Size;
			this.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.FlatAppearance.BorderSize = 0;
			BackgroundImage = ResourceManager.Current.TorchlightButtonNormal;
		}

		protected override void InitLayout()
		{
			DoubleBuffered = true;
			base.InitLayout();
		}

		protected override void OnMouseEnter(EventArgs e)
		{
			BackgroundImage = ResourceManager.Current.TorchlightButtonHighlight;
			base.OnMouseEnter(e);
		}

		protected override void OnMouseLeave(EventArgs e)
		{
			BackgroundImage = ResourceManager.Current.TorchlightButtonNormal;
			base.OnMouseLeave(e);
		}

		protected override void OnMouseDown(MouseEventArgs mevent)
		{
			BackgroundImage = ResourceManager.Current.TorchlightButtonClickHighlight;
			base.OnMouseDown(mevent);
		}

		protected override void OnMouseUp(MouseEventArgs mevent)
		{
			BackgroundImage = ResourceManager.Current.TorchlightButtonHighlight;
			base.OnMouseUp(mevent);
		}

		protected override void OnPaint(PaintEventArgs pevent)
		{
			base.OnPaint(pevent);
		}
	}
}
